<template>
	<view class="container">
		<view class="topinfo">
			<image class="icon" v-if="result == 1" src="../../../static/images/success.png"></image>
			<image class="icon" v-else src="../../../static/images/failure.png"></image>
			<view class="text" v-if="result == 1">支付成功</view>
			<view class="text" v-else>支付失败</view>
		</view><!-- 轮播图 end -->
		<view class="info_container">
			<view class="desc">可在我的订单中查看</view>
			<view class="foot">
				<view class="text1" @click="goHome">返回首页</view>
				<view class="text2" @click="goOrder">我的订单</view>
			</view>
		</view><!--info-->
	</view>
</template>

<script>
	
	export default {
		data() {
			return {
				result:1 //1是成功 0是失败
			}
		},
		onLoad() {
			
		},
		methods: {
			goHome(){
				uni.switchTab({
					url: '/pages/news/index/index'
				})
			},
			goOrder(){
				uni.navigateTo({
					url: '/pages/news/order/list'
				})
			}
		}
	}
</script>

<style lang="scss" scope>
	.container {
		background-color: #F5F5F5;
		padding-bottom: 0;
		padding-bottom: constant(safe-area-inset-bottom);  
		padding-bottom: env(safe-area-inset-bottom); 
	}
	.topinfo{
		display: flex;
		flex-direction: column;
		align-items: center;
		background-color: white;
		padding: 30rpx;
		.icon{
			width: 100rpx;
			height:100rpx;
		}
		.text{
			font-size: 30rpx;
			font-weight: bold;
			color: black;
			margin-top: 30rpx;
		}
	}
	
	.info_container{
		display: flex;
		flex-direction: column;
		background-color: white;
		margin-top: 10rpx;
		padding-bottom: 50rpx;
		.desc{
			color: black;
			font-size: 28rpx;
			text-align: center;
			margin-top: 30rpx;
		}
		.foot {
			display: flex;
			align-items: center;
			justify-content: center;
			margin-top: 30rpx;
		
			.text1 {
				font-size: 30rpx;
				color: #e93323;
				width: 240rpx;
				height: 70rpx;
				background-color: #ffff;
				border: 1px solid #e93323;
				border-radius: 50rpx;
				text-align: center;
				line-height: 70rpx;
			}
		
			.text2 {
				font-size: 30rpx;
				color: #fff;
				width: 240rpx;
				height: 70rpx;
				background-color: #e93323;
				border-radius: 50rpx;
				text-align: center;
				line-height: 70rpx;
				margin-left: 30rpx;
			}
		}
	}
	
</style>
